package main

import "fmt"

func main() {
	fmt.Println("r1 = ", double(4))
	fmt.Println("r2 = ", triple(4))
}

func double(x int) (result int) {
	defer func() {
		fmt.Printf("double(%d) = %d\n", x, result)
	}()
	return x + x
}

func triple(x int) (result int) {
	defer func() { result += x }()
	return double(x)
}
